Skip to content

Conversation

@BenMcH
Copy link
Contributor

@BenMcH BenMcH commented Jan 17, 2021

Fixes #850

Upon investigation into this query, I discovered that the new query is looking at the table sys.key_constraints which includes both primary keys as well as unique constraints, which is not what we want.

Originally, I tried adding this check to the where clause, but my schema dump was missing any table without a primary key. After adding this to the join, I was able to successfully dump my schema, build a test database, and run my specs successfully against the new test database.

CC @wpolicarpo

@wpolicarpo
Copy link
Member

Looks good at first glance, but I'd like to double check with a minimal reproducible script before merging.

Do you think we could write a test for this?

@BenMcH
Copy link
Contributor Author

BenMcH commented Jan 19, 2021

I'll take a look at writing a test for this, yes!

@BenMcH
Copy link
Contributor Author

BenMcH commented Jan 23, 2021

@wpolicarpo All pushed up 😄

I reverted my change while writing the test, so I am sure that the test will fail if there is another regression. All tests were passing locally

@wpolicarpo wpolicarpo merged commit 91d5c4d into rails-sqlserver:master Feb 2, 2021
@wpolicarpo
Copy link
Member

Thanks for the contribution @BenMcH. I'll cut a new release soon.

@BenMcH
Copy link
Contributor Author

BenMcH commented Feb 5, 2021

Thank you @wpolicarpo! We look forward to pulling in the update 😄

@BenMcH
Copy link
Contributor Author

BenMcH commented Feb 12, 2021

@wpolicarpo is this going to be released soon?

@wpolicarpo
Copy link
Member

Sorry for the delay here @BenMcH. I'll cut a new release today or tomorrow, I promise.

@wpolicarpo
Copy link
Member

Version 6.0.1 released with your fix @BenMcH.

@BenMcH
Copy link
Contributor Author

BenMcH commented Feb 17, 2021

Thank you, @wpolicarpo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schema dumping in the Rails 6.0.0 Release is Broken Given a Table With Multiple Unique Constraints

2 participants